/**
 * @(#)com.example.mapper.UserMapper
 *
 * Copyright (c) 2014-2018 上海纬视瑞科技有限公司
 *
 * DESC:
 *
 */
package com.example.mapper;

import com.example.bean.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author fusf
 * @version 1.0  2017/4/12
 */
public interface UserMapper {

    @Select("SELECT * FROM t_user WHERE id = #{id}")
    User selectUser(Long id);

    @Select("select *from t_user")
    List<User> findAll();

    @Insert("insert into t_user ( name, age, address,birthday) values (#{name}, #{age}, #{address},#{birthday})")
    int insert(User user);

    @Update(" update t_user set name =  #{name} where id= #{id}")
    int update(User user);

    @Delete("delete from t_user  where id= #{id}")
    int delete(Long id);


}
